import axios from 'axios';

import { axiosConfig } from '../env';

const apiClient = axios.create(axiosConfig);

/**
 * 用户登录
 * @param {object} credentials - 包含 username 和 password 的对象
 * @returns Promise
 */
export const login = (credentials) => {
    return apiClient.post('/auth/login', credentials);
};

/**
 * 用户登出
 * @returns Promise
 */
export const logout = () => {
    return apiClient.post('/auth/logout');
};